<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <h2>块级作用域</h2>
</body>
<script>
    if(true) {
        let str='china'
        console.log('1:',str)
    }
 
    //console.log('2:',str)

    for(let i=0;i<5;i++) {
        console.log('内部:',i)
    }

    console.log('3:',i)

</script>
</html>